<template>
  <van-collapse v-model="activeNames">
    <van-collapse-item title="会议详情" name="1" icon="coupon-o">
      <template>
        <van-row>
          <van-col span="7" class="col_text_right"><span class="spanTitle">会议纪要</span> </van-col>
          <van-col span="17"><span class="spanValue">{{form.MeetingTitle}}</span></van-col>
        </van-row>
        <van-row>
          <van-col span="7" class="col_text_right"><span class="spanTitle">会议时间</span> </van-col>
          <van-col span="17"><span class="spanValue">{{form.MeetingDate|formatDateTime}}</span></van-col>
        </van-row>
        <van-row>
          <van-col span="7" class="col_text_right"><span class="spanTitle">会议地点</span> </van-col>
          <van-col span="17"><span class="spanValue">{{form.MeetingAddress}}</span></van-col>
        </van-row>
        <van-row>
          <van-col span="7" class="col_text_right"><span class="spanTitle">会议主持</span> </van-col>
          <van-col span="17"><span class="spanValue">{{form.MeetingHost}}</span></van-col>
        </van-row>
        <van-row>
          <van-col span="7" class="col_text_right"><span class="spanTitle">参会人员</span> </van-col>
          <van-col span="17"><span class="spanValue">{{form.MeetingPersons}}</span></van-col>
        </van-row>
        <van-row>
          <van-col span="7" class="col_text_right"><span class="spanTitle">会议记录人</span> </van-col>
          <van-col span="17"><span class="spanValue">{{form.MeetingContent}}</span></van-col>
        </van-row>
        <van-row>
          <van-col span="7" class="col_text_right"><span class="spanTitle">会议议程</span> </van-col>
          <van-col span="17"><span class="spanValue">{{form.MeetingAgenda}}</span></van-col>
        </van-row>
        <van-row>
          <van-col span="7" class="col_text_right"><span class="spanTitle">主题词</span> </van-col>
          <van-col span="17"><span class="spanValue">{{form.MeetingSubject}}</span></van-col>
        </van-row>
      </template>
    </van-collapse-item>
    <van-collapse-item title="会议纪要" name="2" icon="send-gift-o">
      <template>
        <div class="operate_det" v-for="(item, index) in form.Details" :key="index">
          <van-row>
            <van-col span="24">
              <van-row>
                <van-col span="7" class="col_text_right"><span class="spanTitle">{{index+1}}、纪要标题</span></van-col>
                <van-col span="17"><span class="spanValue">{{item.MinutesTitle}}</span></van-col>
              </van-row>
              <van-row>
                <van-col span="7" class="col_text_right"><span class="spanTitle">纪要内容</span></van-col>
                <van-col span="17"><span class="spanValue">{{item.MinutesContent}}</span></van-col>
              </van-row>
            </van-col>
          </van-row>
          <van-row>
            <van-col span="24">
              <van-divider></van-divider>
            </van-col>
          </van-row>
        </div>
      </template>
    </van-collapse-item>
    <van-collapse-item title="决议事项" name="3" icon="comment-circle-o">
      <div class="operate_det" v-for="(item, index) in form.Details2" :key="index">
        <van-row>
          <van-col span="24">
            <van-row>
              <van-col span="10" class="col_text_right"><span class="spanTitle">
                  决议内容 </span></van-col>
              <van-col span="14"><span class="spanValue">{{item.ResolutionContent}}</span> </van-col>
            </van-row>
            <van-row>
              <van-col span="10" class="col_text_right"><span class="spanTitle">责任部门/负责人</span></van-col>
              <van-col span="14"><span class="spanValue">{{item.UserOrDept}}</span></van-col>
            </van-row>
            <van-row>
              <van-col span="10" class="col_text_right"><span class="spanTitle">完成日期</span></van-col>
              <van-col span="14"><span class="spanValue">{{item.FinishDate|formatDate}}</span></van-col>
            </van-row>
          </van-col>
        </van-row>
        <van-row>
          <van-col span="24">
            <van-divider></van-divider>
          </van-col>
        </van-row>
      </div>
    </van-collapse-item>
    <van-collapse-item title="其他" name="4" icon="photo-o">
      <template>
        <van-row>
          <van-col span="24">
            <file-format :attachs="form.Attachs" labelName="附件"> </file-format>
          </van-col>
        </van-row>
        <van-row>
          <van-col span="6" class="col_text_right"><span class="spanTitle">接收对象</span></van-col>
          <van-col span="18"><span class="spanValue">{{ReceiverUserName}}</span></van-col>
        </van-row>
      </template>
    </van-collapse-item>
  </van-collapse>
</template>

<script>
import FileFormat from "../../../components/Attach/FileFormat.vue";

export default {
  components: { FileFormat },
  data() {
    return {
      id: this.$route.query.id,
      autoSize: true,
      form: {},
      activeNames: ["1"],
      ReceiverUserName: ""
    };
  },
  created() {
    this.getDetail();
  },
  methods: {
    getDetail() {
      var me = this;
      let params = { id: this.id };
      this.$axios
        .get(this.$constUrl.CommonMeeting_GetDetail, { params: params })
        .then((res) => {
          me.form = res.data;
          me.form.TypeList =
            me.form.Type == null ? [] : me.form.Type.split(",");
          var names = "";
          var addHtml = ",";
          if (me.form.Details3 != null && me.form.Details3.length > 0) {
            for (var i = 0; i < me.form.Details3.length; i++) {
              if (i == me.form.Details3.length - 1) {
                addHtml = "";
              }
              names += me.form.Details3[i].ReceiverUserName + addHtml;
            }
          }
          me.ReceiverUserName = names;
        });
    },
  },
};
</script>
<style lang="less">
.col_text_right {
  text-align: right;
}
.spanTitle {
  font-size: 14px;
  color: #323233;
  width: 80px;
  line-height: 28px;
  margin-right: 20px;
}
.spanValue {
  font-size: 14px;
  color: #323233;
  line-height: 28px;
}
</style>